package com.sms.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sms.mapper.ConsignmentProductsMapper;
import com.sms.pojo.ConsignmentProducts;
import com.sms.service.ConsignmentProductsService;
import com.sms.util.SqlSessionFactoryUtil;
import lombok.Getter;
import org.apache.ibatis.session.SqlSession;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@Getter
public class ConsignmentProductsServiceImpl extends ServiceImpl<ConsignmentProductsMapper,ConsignmentProducts> implements ConsignmentProductsService {

    SqlSession sqlSession=null;
    @Override
    public ConsignmentProductsMapper getBaseMapper() {
        sqlSession= SqlSessionFactoryUtil.getFactory().openSession(true);
        ConsignmentProductsMapper mapper = SqlSessionFactoryUtil.getFactory().getConfiguration().getMapper(ConsignmentProductsMapper.class, sqlSession);
        return mapper;
    }

    @Override
    public List<ConsignmentProducts> listConsignmentProducts() {
        return this.getBaseMapper().listConsignmentProducts();
    }

}
